Add bounds check before memcpy/strncpy in dump_pool_info handler - #9110
Open
Pyolar wants to merge 1 commit into
Open
Add bounds check before memcpy/strncpy in dump_pool_info handler#9110Pyolar wants to merge 1 commit into
Pyolar wants to merge 1 commit into
Conversation
Member
|
Really correct handling should return corresponding error, not silently ignore the value passed. But, this internal and not documented SPB item is no-op for a long time, and better will be to remove it or to complete implementation, imho. This is not demand for you to go in this way, just call for opinions - should we fix it properly or remove it finally. |
Contributor
|
Taking into account that +1 for complete removal. |
This SPB item has never worked - items pointer is not advanced after the copy, causing an infinite loop. The handler also reads a network-supplied length without checking it against the SPB buffer boundary. Remove both occurrences in Service::query() and Service::query2(). Per maintainers' feedback, dead code is better deleted than fixed.
Pyolar
force-pushed
the
fix/dpb-clumplet-bounds-check
branch
from
July 31, 2026 07:31
74a5252 to
39b17e8
Compare
Author
|
Removed both dead |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Service::query() and Service::query2() both handle isc_info_svc_dump_pool_info
by reading a 2-byte length from the SPB, advancing items past it, then
calling memcpy / strncpy to copy data into fname.
length2 is only checked against sizeof(fname) to prevent destination
overflow. There is no check that items + length2 stays within the SPB
buffer (end_items / end_items2). A crafted SPB with a dump_pool_info
clumplet whose declared length exceeds the remaining buffer causes
out-of-bounds read from the items pointer.
Fix: clamp length2 to 0 when items >= end or items + length2 > end.